//
//  ThreeViewController.m
//  练习
//
//  Created by 王成龙 on 16/5/28.
//  Copyright © 2016年 wcl. All rights reserved.
//

#import "ThreeViewController.h"

@interface ThreeViewController ()
{
    NSArray *data;
    
    

}
@end


@implementation ThreeViewController
- (void)viewDidLoad {
    [super viewDidLoad];
    self.title=@"书名";
    self.view.backgroundColor=[UIColor blueColor];//背景颜色
    
        data = @[
             @"动漫",
             @"搞怪",
             @"搞笑"
             ];
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return data.count;
}


-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell * call = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:nil];
    //添加图片
    NSString * imgName = [NSString stringWithFormat:@"%ld",indexPath.row +8];
    call.imageView.image = [UIImage imageNamed:imgName];
    //图片变圆的
    call.imageView.layer.cornerRadius = 18;
    
    call.textLabel.text =data[indexPath.row];
    //可以改每一行的颜色
    //call.backgroundColor =[UIColor colorWithRed:2*indexPath.row/255.0 green:3*indexPath.row/9000.0 blue:5*indexPath.row/255.0 alpha:1];
    call.accessoryType =UITableViewCellAccessoryDisclosureIndicator;//后面箭头
    return call;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}


@end
